<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../css/register.css" />
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../js/form/jquery.form.js"></script>
<title>用户注册</title>
<script type="text/javascript" >
$.checkLogin = function(){
	var userLoginName=$("#userDTO\\.userLoginName").val();
	if(userLoginName==""){
		$("#tip").html("登录名不能为空");
		$("#tip").css('visibility', 'visible');
		return false;
	}else if($("#userDTO\\.userNickName").val()==""){
		$("#tip").html("昵称不能为空");
		$("#tip").css('visibility', 'visible');
		return false;
	}else{
		$("#tip").css('visibility', 'hidden');
		return true;
	}
}
$.checkPwd = function(){
	var rightPwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;
	if($("#userDTO\\.userPwd").val() == ""){
		$("#tip").html("密码不能为空");
		$("#tip").css('visibility', 'visible');
		return false;
	}else if(rightPwd.test($("#userDTO\\.userPwd").val())==false){
		$("#tip").html("密码由6-20位数字和字母组成");
		$("#tip").css('visibility', 'visible');
		return false;
		//$("#pwdHelp").css('visibility', 'visible');
	}else if($("#userDTO\\.userPwd").val()!=$("#surePwd").val()){
		$("#tip").html("密码不一致");
		$("#tip").css('visibility', 'visible');
		return false;
	}else{
		$("#tip").css('visibility', 'hidden');
		return true;
	}
}
$.regsCheck = function(){
	 if($.checkLogin()==true){
		if($.checkPwd()==true){
			var option = {
					type : 'post',
					dataType : 'text',
					url : '../user/regCheck.action',
					success : function(msg) {
						alert(msg);
					}
				};
			$("#regForm").ajaxSubmit(option);
		}
	} 
}
</script>
</head>
<body>
<div id="topDiv">
<div class="logo"><img src="../images/earth-globe.png"/></div><div class="logo1">招聘网</div>
</div>
<div id="mainContent">
<div class="topTip">
<img src="../images/person.png"/><span>个人注册</span><br>
<span id="tip" style="visibility:hidden;">提示信息</span>
</div>
<form name="regForm" id="regForm" method="post">
<ul class="nopoint">
<li><label for="userDTO.userLoginName">登录名：</label><input type="text" name="userDTO.userLoginName" id="userDTO.userLoginName"/></li>
<li><label for="userDTO.userNickName">昵称：</label>&nbsp;&nbsp;&nbsp;<input type="text" name="userDTO.userNickName" id="userDTO.userNickName"/></li>
<li><label for="userDTO.userPwd">密码：</label>&nbsp;&nbsp;&nbsp;<input type="password" name="userDTO.userPwd" id="userDTO.userPwd"/></li>
<li><label for="surePwd">确认：</label>&nbsp;&nbsp;&nbsp;<input type="password" name="surePwd" id="surePwd"/></li>
<li><input type="button" value="注册" onclick="$.regsCheck()"></li>
</ul>
</form>
</div>
</body>
</html>